<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>国内折扣详情</title>
</head>
<link rel="stylesheet" href="css/coupon.css">
<link href="lib/bootstrap/css/bootstrap.css" rel="stylesheet">
<script src="lib/html5shiv/html5shiv.min.js"></script>
<script src="lib/respond/respond.js"></script>
<script src="js/template.js"></script>
<script src="lib/jquery/jquery.js"></script>
<script src="js/coupon.js"></script>

<script type="text/html" id="template">
    {{if result}}
    {{each result as value}}
    <!--<li><a href=">{{#value.couponImg}}</a></li>-->
    <ul>
    <li><a href=    couponproduct.html?couponid={{value.couponId}}>
        <img src="{{value.couponImg}}" alt="">
    </a></li>
    </ul>
    {{/each}}
    {{/if}}
</script>
<body>
<!--顶部-->
<div class="shen clearfix ">
    <a href="index.html" class="glyphicon glyphicon-chevron-left fl"></a>
    <div class="fl">优惠券</div>
    <img src="images/header_app.png" alt="" class="fr">
</div>
<!--商品-->
<div class="main">

        <!--<li><a href=""></a></li>-->
        <!--<li><a href=""></a></li>-->
        <!--<li><a href=""></a></li>-->

</div>


<!--底部-->
<ul class="na clearfix" role="tablist">
    <li><a href="#">登陆</span></a></li>
    <li><a href="#">注册</a></li>
    <li><a href="#">返回顶部 </a></li>
</ul>
<div class="gong">手机APP下载<a href=""> 慢慢买手机版 --掌上比价平台</a>
    <p>m.m.maimai.com</p>
</div>
</body>
<script>
$.ajax({
    type: 'get',
    url: 'http://192.168.23.81:3000/api/getcoupon',
    dataType: 'json',
    success:function (data) {
        console.log(data.result[1].couponId);
        var html=template("template",data)
        $(".main").html(html)
    }
})

</script>
</html>